home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 June / ChipCD 6.02.iso / macos / files / dragburn.sit / DragonBurn / Dragon Burn Installer / WebHelp / BSSCDHTM.JS < prev    next >
Text File  |  2000-07-20  |  72KB  |  2,290 lines

  1. //////////BSSCDHTML Section 1//////////
  2. // RoboHELP« Dynamic HTML Effects Script
  3. // Copyright ⌐ 1998-2000 eHelp Corporation.  All rights reserved.
  4.  
  5. // Version=3.72
  6.  
  7. // Warning:  Do not modify this file.  It is generated by RoboHELP« and changes will be overwritten.
  8.  
  9. //{{HH_SYMBOL_SECTION
  10. var HH_ChmFilename = "";
  11. var HH_WindowName = "";
  12. var HH_GlossaryFont = "";
  13. var HH_Glossary = "";
  14. var HH_Avenue = "";
  15. var HH_ActiveX = false;
  16. //}}HH_SYMBOL_SECTION
  17.  
  18. var gbNav4 = false;
  19. var gbIE4 = false;
  20. var gbIE = false;
  21. var gbIE5 = false;
  22. var gbIE55 = false;
  23. var gAgent = navigator.userAgent.toLowerCase(); 
  24. var gbMac = (gAgent.indexOf("mac") != -1);
  25. var gbWindows = ((gAgent.indexOf("win") != -1) || (gAgent.indexOf("16bit") != -1));
  26.  
  27. var error_count = 0;
  28.  
  29. gbIE = (navigator.appName.indexOf("Microsoft") != -1);
  30. if (parseInt(navigator.appVersion) >= 4) {
  31.     gbNav4 = (navigator.appName == "Netscape");
  32.     gbIE4 = (navigator.appName.indexOf("Microsoft") != -1);
  33.  
  34.     if (gbIE4) {
  35.         if (gAgent.indexOf("msie 5.0") != -1) {
  36.             gbIE5 = true;
  37.         }
  38.         if (gAgent.indexOf("msie 5.5") != -1) { // curently IE 5.5 has some buggy stuff. we need do some remedy to our code.
  39.             gbIE55 = true;
  40.         }
  41.     }
  42. }
  43.  
  44. function HHActivateComponents()
  45. {
  46.     if (HH_ActiveX && (HH_ChmFilename != "") && ((self == top) || (self == top.frames[0])))
  47.     {
  48.         var objBody = document.all.tags("BODY")[0];
  49.         if( typeof(objBody) == "object" )
  50.         {
  51.             objBody.insertAdjacentHTML("beforeEnd", '<OBJECT ID="HHComponentActivator" CLASSID="CLSID:399CB6C4-7312-11D2-B4D9-00105A0422DF" width=0 height=0></OBJECT>');
  52.             if (HHComponentActivator.object)
  53.             {
  54.                 HHComponentActivator.Activate(HH_ChmFilename, HH_WindowName, HH_GlossaryFont, HH_Glossary, HH_Avenue);
  55.             }
  56.         }
  57.     }
  58. }
  59.  
  60. var gAmc = new Array();
  61. var BSSCSequenceIndex = 0;
  62.  
  63. function animationContext(el, progressAnimation, finishAnimiation, animationDuration, animationPeriod)
  64. {
  65.     this.el = el;
  66.     this.progressAnimation = progressAnimation;
  67.     this.finishAnimiation = finishAnimiation;
  68.     this.animationDuration = parseFloat(animationDuration);
  69.     this.animationPeriod = animationPeriod;
  70.     this.animationStartTime = (new Date()).getTime();
  71.     this.continueAnimation = true;
  72. }
  73.  
  74. function progressFade(ndx)
  75. {
  76.     if( typeof( gAmc[ndx].el.filters.alpha ) != "object" )
  77.         return;
  78.     
  79.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  80.     if (percent > 1.0){
  81.         percent = 1.0;
  82.         gAmc[ndx].continueAnimation = false;
  83.     }
  84.     gAmc[ndx].el.filters.alpha.opacity = gAmc[ndx].initialOpacity*(1.0-percent) +  gAmc[ndx].finalOpacity*percent;
  85.     
  86. }
  87.  
  88. function finishFade(ndx)
  89. {
  90.     if( typeof( gAmc[ndx].el.filters.alpha ) == "object" )
  91.         gAmc[ndx].el.filters.alpha.opacity = parseInt(gAmc[ndx].finalOpacity);
  92. }
  93.  
  94. function progressTranslation(ndx)
  95. {
  96.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  97.     if (percent > 1.0)    {
  98.         percent = 1.0;
  99.         gAmc[ndx].continueAnimation = false;
  100.     }
  101.     gAmc[ndx].el.style.pixelLeft = gAmc[ndx].startX*(1.0-percent) +  gAmc[ndx].finalX*percent;
  102.     gAmc[ndx].el.style.pixelTop = gAmc[ndx].startY*(1.0-percent) +  gAmc[ndx].finalY*percent;
  103. }
  104. function progressSpiral(ndx)
  105. {
  106.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  107.     if (percent > 1.0)    {
  108.         percent = 1.0;
  109.         gAmc[ndx].continueAnimation = false;
  110.     }
  111.     rf = 1.0 - percent
  112.     t = percent * 2.0*Math.PI
  113.     rx = Math.max(Math.abs(gAmc[ndx].el.initLeft), 200)
  114.     ry = Math.max(Math.abs(gAmc[ndx].el.initTop),  200)
  115.     gAmc[ndx].el.style.pixelLeft = Math.ceil(-rf*Math.cos(t)*rx)
  116.     gAmc[ndx].el.style.pixelTop  = Math.ceil(-rf*Math.sin(t)*ry)
  117.     gAmc[ndx].el.style.visibility="visible"    
  118. }
  119.  
  120. function progressElasticFromRight(ndx)
  121. {
  122.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  123.     if (percent > 1.0)    {
  124.         percent = 1.0;
  125.         gAmc[ndx].continueAnimation = false;
  126.     }
  127.     rf=Math.exp(-percent*7)
  128.     t = percent * 1.5*Math.PI
  129.     rx =Math.abs(gAmc[ndx].el.initLeft)
  130.     gAmc[ndx].el.style.pixelLeft = rf*Math.cos(t)*rx
  131.     gAmc[ndx].el.style.pixelTop = 0
  132.     gAmc[ndx].el.style.visibility="visible"    
  133. }
  134. function progressElasticFromBottom(ndx)
  135. {
  136.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  137.     if (percent > 1.0)    {
  138.         percent = 1.0;
  139.         gAmc[ndx].continueAnimation = false;
  140.     }
  141.     rf=Math.exp(-percent*7)
  142.     t = percent * 1.5*Math.PI
  143.     rx =Math.abs(gAmc[ndx].el.initTop)
  144.     gAmc[ndx].el.style.pixelLeft = 0
  145.     gAmc[ndx].el.style.pixelTop = rf*Math.cos(t)*rx
  146.     gAmc[ndx].el.style.visibility="visible"    
  147. }
  148.  
  149. function progressZoomIn(ndx)
  150. {
  151.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  152.     if (percent > 1.0)    {
  153.         percent = 1;
  154.         gAmc[ndx].continueAnimation = false;
  155.     }
  156.     for (var index=0; index<gAmc[ndx].el.all.length; index++) {
  157.         gAmc[ndx].el.all[index].style.fontSize = Math.ceil(50+50*percent) + "%"
  158.     }
  159.     gAmc[ndx].el.posLeft = 100
  160.     gAmc[ndx].el.style.visibility="visible"
  161.  
  162.     if (percent >= 1.0)    {
  163.         finishZoom(ndx);
  164.     }
  165. }
  166.  
  167. function progressZoomOut(ndx)
  168. {
  169.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  170.     if (percent > 1.0)    {
  171.         percent = 1.0;
  172.         gAmc[ndx].continueAnimation = false;
  173.     }
  174.  
  175.     for (var index=0; index<gAmc[ndx].el.all.length; index++)
  176.         gAmc[ndx].el.all[index].style.fontSize = Math.ceil(100+200*(1-percent)) + "%"
  177.     gAmc[ndx].el.posLeft = 0
  178.     gAmc[ndx].el.style.visibility="visible"
  179.  
  180.     if (percent >= 1.0)    {
  181.         finishZoom(ndx);
  182.     }
  183. }
  184. function finishTranslation(ndx)
  185. {
  186.     gAmc[ndx].el.style.pixelLeft = parseInt(gAmc[ndx].finalX);
  187.     gAmc[ndx].el.style.pixelTop = parseInt(gAmc[ndx].finalY);
  188. }
  189. function finishZoom(ndx)
  190. {
  191.     for (i=0; i<gAmc[ndx].el.all.length; i++)
  192.         gAmc[ndx].el.all[i].style.fontSize = gAmc[ndx].OldFont
  193.  
  194.  
  195. function animationPump(ndx)
  196. {
  197.     gAmc[ndx].progressAnimation(ndx);
  198.     if (gAmc[ndx].continueAnimation)
  199.         gAmc[ndx].tm = setTimeout("animationPump(" + ndx + ");", gAmc[ndx].animationPeriod);
  200. }
  201.  
  202. function clearAnimations()
  203. {
  204.     for (var index=0; index<gAmc.length; index++) {
  205.         gAmc[index].finishAnimiation(index);
  206.         clearTimeout(gAmc[index].tm);
  207.     }
  208.     gAmc = new Array();
  209. }
  210.  
  211. function startNextAnimationSet()
  212. {
  213.     clearAnimations();
  214.     bStarted = false;
  215.     bFound = false
  216.  
  217.     // Determine the next sequence number
  218.     divElements = document.all.tags("DIV");
  219.     for (var index = 0; index < divElements.length; index++) 
  220.     {
  221.         el = divElements[index];
  222.         objectOrder = el.getAttribute("BSSCObjectOrder", false);
  223.         if(null != objectOrder)
  224.         {
  225.             objectOrder = parseInt(objectOrder);
  226.             if (objectOrder > BSSCSequenceIndex && (!bFound || objectOrder < minBSSCSequenceIndexFound))
  227.             {
  228.                 minBSSCSequenceIndexFound = objectOrder;
  229.                 bFound = true;
  230.             }
  231.         }
  232.     }
  233.  
  234.     if (bFound)
  235.     {
  236.         BSSCSequenceIndex = minBSSCSequenceIndexFound;
  237.         bStarted = startAnimationSet(BSSCSequenceIndex);
  238.     }
  239. }
  240.  
  241. function getOffsetFromTopOfBrowser(el)
  242. {
  243.     if (null == el.offsetParent)
  244.         return el.offsetTop;
  245.     else
  246.         return el.offsetTop + getOffsetFromTopOfBrowser(el.offsetParent);
  247. }
  248.  
  249. function startAnimationSet(ndx)
  250. {
  251.     var m = 0;
  252.     bStarted = false;
  253.  
  254.     // Find document elements with "BSSCAnimationType" attribute
  255.     divElements = document.all.tags("DIV");
  256.     for (var index = 0; index < divElements.length; index++)
  257.     {
  258.         el = divElements[index];
  259.         
  260.         animationType = el.getAttribute("BSSCAnimationType", false);
  261.         if(null != animationType)
  262.         {
  263.             framePeriod = el.getAttribute("BSSCFramePeriod", false);
  264.             frameCount = el.getAttribute("BSSCFrameCount", false);
  265.             sequenceIndex = el.getAttribute("BSSCObjectOrder", false);
  266.  
  267.             // Stop any currently running RevealTrans filters
  268.             if ("RevealTrans" == animationType && parseInt(sequenceIndex) == ndx-1 && gbWindows)
  269.                 el.filters.RevealTrans.stop();  
  270.             // Filter on ndx
  271.             if (0 == ndx && null == sequenceIndex ||
  272.                 ndx == parseInt(sequenceIndex))
  273.             {
  274.                 if ("FlyInFromRight" == animationType)
  275.                 {
  276.                     animationDuration = el.getAttribute("BSSCDuration", false);
  277.                     if (null == animationDuration)
  278.                         animationDuration = 1000; // default to 1s
  279.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  280.                     gAmc[m].startX = document.body.clientWidth + document.body.scrollLeft;
  281.                     gAmc[m].startY = 0;
  282.                     gAmc[m].finalX = 0;
  283.                     gAmc[m].finalY = 0;
  284.                     animationPump(m++);
  285.                     bStarted = true;
  286.                 }
  287.                 if ("FlyOutToRight" == animationType)
  288.                 {
  289.                     animationDuration = el.getAttribute("BSSCDuration", false);
  290.                     if (null == animationDuration)
  291.                         animationDuration = 1000; // default to 1s
  292.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  293.                     gAmc[m].startX = 0;
  294.                     gAmc[m].startY = 0;
  295.                     gAmc[m].finalX = document.body.clientWidth + document.body.scrollWidth;
  296.                     gAmc[m].finalY = 0;
  297.                     animationPump(m++);
  298.                     bStarted = true;
  299.                 }
  300.                 if ("FlyInFromLeft" == animationType)
  301.                 {
  302.                     animationDuration = el.getAttribute("BSSCDuration", false);
  303.                     if (null == animationDuration)
  304.                         animationDuration = 1000; // default to 1s
  305.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  306.                     {
  307.                         if ("left" == el.children[childIndex].style.textAlign)
  308.                             el.children[childIndex].style.textAlign = "right";
  309.                     }
  310.                     pixelsToTranslate = document.body.clientWidth;
  311.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  312.                     gAmc[m].startX = -(document.body.clientWidth + document.body.scrollLeft);
  313.                     gAmc[m].startY = 0;
  314.                     gAmc[m].finalX = 0;
  315.                     gAmc[m].finalY = 0;
  316.                     animationPump(m++);
  317.                     bStarted = true;
  318.                 }
  319.                 if ("FlyOutToLeft" == animationType)
  320.                 {
  321.                     animationDuration = el.getAttribute("BSSCDuration", false);
  322.                     if (null == animationDuration)
  323.                         animationDuration = 1000; // default to 1s
  324.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  325.                     {
  326.                         if ("left" == el.children[childIndex].style.textAlign)
  327.                             el.children[childIndex].style.textAlign = "right";
  328.                     }
  329.                     pixelsToTranslate = document.body.clientWidth;
  330.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  331.                     gAmc[m].startX = 0;
  332.                     gAmc[m].startY = 0;
  333.                     gAmc[m].finalX = -(document.body.clientWidth + document.body.scrollWidth);
  334.                     gAmc[m].finalY = 0;
  335.                     animationPump(m++);
  336.                     bStarted = true;
  337.                 }
  338.                 if ("FlyInFromBottom" == animationType)
  339.                 {
  340.                     animationDuration = el.getAttribute("BSSCDuration", false);
  341.                     if (null == animationDuration)
  342.                         animationDuration = 1000; // default to 1s
  343.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  344.                     gAmc[m].startX = 0;
  345.                     gAmc[m].startY = document.body.clientHeight + document.body.scrollTop;
  346.                     gAmc[m].finalX = 0;
  347.                     gAmc[m].finalY = 0;
  348.                     animationPump(m++);
  349.                     bStarted = true;
  350.                 }
  351.                 if ("FlyOutToBottom" == animationType)
  352.                 {
  353.                     animationDuration = el.getAttribute("BSSCDuration", false);
  354.                     if (null == animationDuration)
  355.                         animationDuration = 1000; // default to 1s
  356.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  357.                     gAmc[m].startX = 0;
  358.                     gAmc[m].startY = 0;
  359.                     gAmc[m].finalX = 0;
  360.                     gAmc[m].finalY = document.body.clientHeight + document.body.scrollHeight;
  361.                     animationPump(m++);
  362.                     bStarted = true;
  363.                 }
  364.                 if ("FlyInFromTop" == animationType)
  365.                 {
  366.                     animationDuration = el.getAttribute("BSSCDuration", false);
  367.                     if (null == animationDuration)
  368.                         animationDuration = 1000; // default to 1s
  369.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  370.                     gAmc[m].startX = 0;
  371.                     gAmc[m].startY = -getOffsetFromTopOfBrowser(el) - el.offsetHeight;
  372.                     gAmc[m].finalX = 0;
  373.                     gAmc[m].finalY = 0;
  374.                     animationPump(m++);
  375.                     bStarted = true;
  376.                 }
  377.                 if ("FlyOutToTop" == animationType)
  378.                 {
  379.                     animationDuration = el.getAttribute("BSSCDuration", false);
  380.                     if (null == animationDuration)
  381.                         animationDuration = 1000; // default to 1s
  382.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  383.                     gAmc[m].startX = 0;
  384.                     gAmc[m].startY = 0;
  385.                     gAmc[m].finalX = 0;
  386.                     gAmc[m].finalY = -getOffsetFromTopOfBrowser(el) - el.offsetHeight;
  387.                     animationPump(m++);
  388.                     bStarted = true;
  389.                 }
  390.                 if ("FlyInFromBottomRight" == animationType)
  391.                 {
  392.                     animationDuration = el.getAttribute("BSSCDuration", false);
  393.                     if (null == animationDuration)
  394.                         animationDuration = 1000; // default to 1s
  395.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  396.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  397.                         pixelsToTranslate = document.body.clientHeight + document.body.scrollTop - el.offsetTop;
  398.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  399.                     gAmc[m].startX = pixelsToTranslate;
  400.                     gAmc[m].startY = pixelsToTranslate;
  401.                     gAmc[m].finalX = 0;
  402.                     gAmc[m].finalY = 0;
  403.                     animationPump(m++);
  404.                     bStarted = true;
  405.                 }
  406.                 if ("FlyOutToBottomRight" == animationType)
  407.                 {
  408.                     animationDuration = el.getAttribute("BSSCDuration", false);
  409.                     if (null == animationDuration)
  410.                         animationDuration = 1000; // default to 1s
  411.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  412.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  413.                         pixelsToTranslate = document.body.clientHeight +document.body.scrollTop - el.offsetTop;
  414.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  415.                     gAmc[m].startX = 0;
  416.                     gAmc[m].startY = 0;
  417.                     gAmc[m].finalX = pixelsToTranslate;
  418.                     gAmc[m].finalY = pixelsToTranslate;
  419.                     animationPump(m++);
  420.                     bStarted = true;
  421.                 }
  422.                 if ("FlyInFromTopRight" == animationType)
  423.                 {
  424.                     animationDuration = el.getAttribute("BSSCDuration", false);
  425.                     if (null == animationDuration)
  426.                         animationDuration = 1000; // default to 1s
  427.                     pixelsToTranslate = document.body.clientWidth;
  428.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  429.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  430.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  431.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  432.                     gAmc[m].startX = pixelsToTranslate;
  433.                     gAmc[m].startY = -pixelsToTranslate;
  434.                     gAmc[m].finalX = 0;
  435.                     gAmc[m].finalY = 0;
  436.                     animationPump(m++);
  437.                     bStarted = true;
  438.                 }
  439.                 if ("FlyOutToTopRight" == animationType)
  440.                 {
  441.                     animationDuration = el.getAttribute("BSSCDuration", false);
  442.                     if (null == animationDuration)
  443.                         animationDuration = 1000; // default to 1s
  444.                     pixelsToTranslate = document.body.clientWidth;
  445.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  446.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  447.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  448.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  449.                     gAmc[m].startX = 0;
  450.                     gAmc[m].startY = 0;
  451.                     gAmc[m].finalX = pixelsToTranslate;
  452.                     gAmc[m].finalY = -pixelsToTranslate;
  453.                     animationPump(m++);
  454.                     bStarted = true;
  455.                 }
  456.                 if ("FlyInFromTopLeft" == animationType)
  457.                 {
  458.                     animationDuration = el.getAttribute("BSSCDuration", false);
  459.                     if (null == animationDuration)
  460.                         animationDuration = 1000; // default to 1s
  461.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  462.                     {
  463.                         if ("left" == el.children[childIndex].style.textAlign)
  464.                             el.children[childIndex].style.textAlign = "right";
  465.                     }
  466.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  467.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  468.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  469.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  470.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  471.                     gAmc[m].startX = -pixelsToTranslate;
  472.                     gAmc[m].startY = -pixelsToTranslate;
  473.                     gAmc[m].finalX = 0;
  474.                     gAmc[m].finalY = 0;
  475.                     animationPump(m++);
  476.                     bStarted = true;
  477.                 }
  478.                 if ("FlyOutToTopLeft" == animationType)
  479.                 {
  480.                     animationDuration = el.getAttribute("BSSCDuration", false);
  481.                     if (null == animationDuration)
  482.                         animationDuration = 1000; // default to 1s
  483.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  484.                     {
  485.                         if ("left" == el.children[childIndex].style.textAlign)
  486.                             el.children[childIndex].style.textAlign = "right";
  487.                     }
  488.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  489.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  490.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  491.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  492.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  493.                     gAmc[m].startX = 0;
  494.                     gAmc[m].startY = 0;
  495.                     gAmc[m].finalX = -pixelsToTranslate;
  496.                     gAmc[m].finalY = -pixelsToTranslate;
  497.                     animationPump(m++);
  498.                     bStarted = true;
  499.                 }
  500.                 if ("FlyInFromBottomLeft" == animationType)
  501.                 {
  502.                     animationDuration = el.getAttribute("BSSCDuration", false);
  503.                     if (null == animationDuration)
  504.                         animationDuration = 1000; // default to 1s
  505.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  506.                     {
  507.                         if ("left" == el.children[childIndex].style.textAlign)
  508.                             el.children[childIndex].style.textAlign = "right";
  509.                     }
  510.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  511.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  512.                         pixelsToTranslate = document.body.clientHeight + document.body.scrollTop - el.offsetTop;
  513.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  514.                     gAmc[m].startX = -pixelsToTranslate;
  515.                     gAmc[m].startY = pixelsToTranslate;
  516.                     gAmc[m].finalX = 0;
  517.                     gAmc[m].finalY = 0;
  518.                     animationPump(m++);
  519.                     bStarted = true;
  520.                 }
  521.                 if ("FlyOutToBottomLeft" == animationType)
  522.                 {
  523.                     animationDuration = el.getAttribute("BSSCDuration", false);
  524.                     if (null == animationDuration)
  525.                         animationDuration = 1000; // default to 1s
  526.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  527.                     {
  528.                         if ("left" == el.children[childIndex].style.textAlign)
  529.                             el.children[childIndex].style.textAlign = "right";
  530.                     }
  531.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  532.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  533.                         pixelsToTranslate = document.body.clientHeight +document.body.scrollTop - el.offsetTop;
  534.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  535.                     gAmc[m].startX = 0;
  536.                     gAmc[m].startY = 0;
  537.                     gAmc[m].finalX = -pixelsToTranslate;
  538.                     gAmc[m].finalY = pixelsToTranslate;
  539.                     animationPump(m++);
  540.                     bStarted = true;
  541.                 }
  542.                 if ("FadeIn" == animationType)
  543.                 {
  544.                     if (gbWindows)
  545.                     {
  546.                         animationDuration = el.getAttribute("BSSCDuration", false);
  547.                         if (null == animationDuration)
  548.                             animationDuration = 1000; // default to 1s
  549.                         finalOpacity = el.getAttribute("BSSCFinalOpacity", false);
  550.                         if (null == finalOpacity)
  551.                             finalOpacity = 100;
  552.                         initialOpacity = el.getAttribute("BSSCInitialOpacity", false);
  553.                         if (null == initialOpacity)
  554.                             initialOpacity = 0;
  555.                         gAmc[m] = new animationContext(el, progressFade, finishFade, animationDuration, 50);
  556.                         el.filters.opacity = initialOpacity;
  557.                         gAmc[m].initialOpacity = initialOpacity;
  558.                         gAmc[m].finalOpacity = finalOpacity;
  559.                         animationPump(m++);
  560.                         bStarted = true;
  561.                     } else {
  562.                         el.style.visibility = "";
  563.                     }
  564.                 }
  565.                 if ("Spiral" == animationType)
  566.                 {
  567.                     animationDuration = el.getAttribute("BSSCDuration", false);
  568.                     if (null == animationDuration)
  569.                         animationDuration = 1000; // default to 1s
  570.  
  571.                     gAmc[m] = new animationContext(el, progressSpiral, finishTranslation, animationDuration, 10);
  572.                     gAmc[m].el.initLeft = el.offsetLeft+document.body.clientWidth;
  573.                     gAmc[m].el.initTop = document.body.scrollTop+el.offsetTop+document.body.clientHeight;
  574.                     gAmc[m].el.endLeft = gAmc[m].el.posLeft;
  575.                     gAmc[m].el.endTop  = gAmc[m].el.posTop;
  576.                     gAmc[m].finalX = 0;
  577.                     gAmc[m].finalY = 0;
  578.                     gAmc[m].steps = 0;
  579.                     animationPump(m++);
  580.                     bStarted = true;
  581.                 }
  582.                 if ("ElasticFromRight" == animationType)
  583.                 {
  584.                     animationDuration = el.getAttribute("BSSCDuration", false);
  585.                     if (null == animationDuration)
  586.                         animationDuration = 1000; // default to 1s
  587.                     gAmc[m] = new animationContext(el, progressElasticFromRight, finishTranslation, animationDuration, 10);
  588.                     gAmc[m].el.initLeft = el.offsetLeft+document.body.clientWidth;
  589.                     gAmc[m].el.initTop = gAmc[m].el.posTop;
  590.                     gAmc[m].el.endLeft = gAmc[m].el.posLeft;
  591.                     gAmc[m].el.endTop  = gAmc[m].el.posTop;
  592.                     gAmc[m].finalX = 0;
  593.                     gAmc[m].finalY = 0;
  594.                     gAmc[m].steps = 0;
  595.                     animationPump(m++);
  596.                     bStarted = true;
  597.                 }
  598.                 if ("ElasticFromBottom" == animationType)
  599.                 {
  600.                     animationDuration = el.getAttribute("BSSCDuration", false);
  601.                     if (null == animationDuration)
  602.                         animationDuration = 1000; // default to 1s
  603.                     gAmc[m] = new animationContext(el, progressElasticFromBottom, finishTranslation, animationDuration, 10);
  604.                     gAmc[m].el.initLeft = gAmc[m].el.posLeft;
  605.                     gAmc[m].el.initTop = document.body.scrollTop-el.offsetTop-el.offsetHeight;
  606.                     gAmc[m].el.endLeft = gAmc[m].el.posLeft;
  607.                     gAmc[m].el.endTop  = gAmc[m].el.posTop;
  608.                     gAmc[m].finalX = 0;
  609.                     gAmc[m].finalY = 0;
  610.                     gAmc[m].steps = 0;
  611.                     animationPump(m++);
  612.                     bStarted = true;
  613.                 }
  614.                 if ("ZoomIn" == animationType)
  615.                 {
  616.                     animationDuration = el.getAttribute("BSSCDuration", false);
  617.                     if (null == animationDuration)
  618.                         animationDuration = 1000; // default to 1s
  619.                     gAmc[m] = new animationContext(el, progressZoomIn, finishZoom, animationDuration, 10);
  620.                     gAmc[m].OldFont = gAmc[m].el.all[0].style.fontSize;
  621.                     animationPump(m++);
  622.                     bStarted = true;
  623.                 }
  624.                 if ("ZoomOut" == animationType)
  625.                 {
  626.                     animationDuration = el.getAttribute("BSSCDuration", false);
  627.                     if (null == animationDuration)
  628.                         animationDuration = 1000; // default to 1s
  629.                     gAmc[m] = new animationContext(el, progressZoomOut, finishZoom, animationDuration, 10);
  630.                     gAmc[m].OldFont = gAmc[m].el.all[0].style.fontSize;
  631.                     animationPump(m++);
  632.                     bStarted = true;
  633.                 }
  634.                 if ("RevealTrans" == animationType)
  635.                 {
  636.                     if (gbWindows) {
  637.                         Duration = el.getAttribute("BSSCDuration", false);
  638.                         if (null == Duration)
  639.                             Duration = 1000; // default to 1s
  640.                         Transition = el.getAttribute("BSSCTransition", false);
  641.                         if (null == Transition)
  642.                             Transition = 0;
  643.                         el.style.filter = "RevealTrans();";
  644.                         el.filters.RevealTrans.Transition = Transition;
  645.                         el.filters.RevealTrans.apply();
  646.                         el.style.visibility = ""; 
  647.                         el.filters.RevealTrans.play(parseInt(Duration)/1000.0);  
  648.                         bStarted = true;
  649.                     } else {
  650.                         el.style.visibility = "";
  651.                     }
  652.                 }
  653.             }
  654.         }
  655.     }
  656.     return bStarted;
  657. }
  658.  
  659. function ApplyTextFormatting(divEl, childEl)
  660. {
  661.     childEl.setAttribute("BSSCOriginalStyle", childEl.style);
  662.  
  663.     // Text Change
  664.     hoverColor = divEl.getAttribute("BSSCHoverColor", false);
  665.     if ("Default" != divEl.getAttribute("BSSCHoverColorName"))
  666.     {
  667.         childEl.setAttribute("BSSCOriginalColor", childEl.style.color);
  668.         childEl.style.color = hoverColor;
  669.     }
  670.     hoverFontName = divEl.getAttribute("BSSCHoverFontName", false);
  671.     if (null != hoverFontName && hoverFontName != "*Default*")
  672.     {
  673.         hoverFontFamily = divEl.getAttribute("BSSCHoverFontFamily", false);
  674.         if (null != hoverFontFamily)
  675.         {
  676.             childEl.setAttribute("BSSCOriginalFontFamily", childEl.style.fontFamily);
  677.             childEl.style.fontFamily = hoverFontFamily;
  678.         }
  679.     }
  680.     hoverFontSize = divEl.getAttribute("BSSCHoverFontSize", false);
  681.     {
  682.         if (null != hoverFontSize && hoverFontSize != "*")
  683.         {
  684.             childEl.setAttribute("BSSCOriginalFontSize", childEl.style.fontSize);
  685.             childEl.style.fontSize = hoverFontSize + "pt";
  686.         }
  687.     }
  688.     hoverFontStyle = divEl.getAttribute("BSSCHoverFontStyle", false);
  689.     if (null != hoverFontStyle && "Regular" != hoverFontStyle)
  690.     {
  691.         if ("Italic" == hoverFontStyle)
  692.         {
  693.             childEl.setAttribute("BSSCOriginalFontStyle", childEl.style.fontStyle);
  694.             childEl.style.fontStyle = "italic";
  695.         }
  696.         else if ("Bold" == hoverFontStyle)
  697.         {
  698.             childEl.setAttribute("BSSCOriginalFontWeight", childEl.style.fontWeight);
  699.             childEl.style.fontWeight = "bold";
  700.         }
  701.         else if ("Bold Italic" == hoverFontStyle)
  702.         {
  703.             childEl.setAttribute("BSSCOriginalFontStyle", childEl.style.fontStyle);
  704.             childEl.style.fontStyle = "italic";
  705.             childEl.setAttribute("BSSCOriginalFontWeight", childEl.style.fontWeight);
  706.             childEl.style.fontWeight = "bold";
  707.         }
  708.     }
  709.     hoverUnderline = divEl.getAttribute("BSSCHoverUnderLine", false);
  710.     if (null != hoverUnderline && hoverUnderline == "TRUE")
  711.     {
  712.         childEl.setAttribute("BSSCOriginalTextDecoration", childEl.style.textDecoration);
  713.         childEl.style.textDecoration = "underline";
  714.     }
  715. }
  716.  
  717. function RemoveTextFormatting(el)
  718. {
  719.     originalColor = el.getAttribute("BSSCOriginalColor", false);
  720.     if (null != originalColor)
  721.         el.style.color = originalColor;
  722.     originalFontFamily = el.getAttribute("BSSCOriginalFontFamily", false);
  723.     if (null != originalFontFamily)
  724.         el.style.fontFamily = originalFontFamily;
  725.     originalFontSize = el.getAttribute("BSSCOriginalFontSize", false);
  726.     if (null != originalFontSize)
  727.         el.style.fontSize = originalFontSize;
  728.     originalFontStyle = el.getAttribute("BSSCOriginalFontStyle", false);
  729.     if (null != originalFontStyle)
  730.         el.style.fontStyle = originalFontStyle;
  731.     originalFontWeight = el.getAttribute("BSSCOriginalFontWeight", false);
  732.     if (null != originalFontWeight)
  733.         el.style.fontWeight = originalFontWeight;
  734.     originalTextDecoration = el.getAttribute("BSSCOriginalTextDecoration", false);
  735.     if (null != originalTextDecoration)
  736.         el.style.textDecoration = originalTextDecoration;
  737. }
  738.  
  739. function BSSCOnMouseOver(el)
  740. {
  741.     // Text Formatting
  742.     hoverColor = el.getAttribute("BSSCHoverColor", false);
  743.     if (null != hoverColor)
  744.         for (var index=0; index<el.all.length; index++)
  745.             ApplyTextFormatting(el, el.all[index]);
  746.  
  747.     // Glow
  748.     glowColor = el.getAttribute("BSSCGlowColor", false);
  749.     if (null != glowColor)
  750.     {
  751.         glowStrength = el.getAttribute("BSSCGlowStrength", false);
  752.         if (null == glowStrength)
  753.             glowStrength = "3";
  754.         glowColorName = el.getAttribute("BSSCGlowColorName");
  755.         if ("Default" == glowColorName)
  756.             el.style.filter = "glow(Strength=" + glowStrength + ", enabled=1)";
  757.         else
  758.             el.style.filter = "glow(Color=#" + glowColor + ", Strength=" + glowStrength + ", enabled=1)";
  759.     }
  760. }
  761.  
  762. function BSSCOnMouseOut(el)
  763. {
  764.     // Text Formatting
  765.     hoverColor = el.getAttribute("BSSCHoverColor", false);
  766.     if (null != hoverColor)
  767.         for (var index=0; index<el.all.length; index++)
  768.             RemoveTextFormatting(el.all[index]);
  769.  
  770.     // Glow
  771.     glowColor = el.getAttribute("BSSCGlowColor", false);
  772.     if (null != glowColor)
  773.         el.style.filter="";
  774. }
  775.  
  776. function doStaticEffects()
  777. {
  778.     divElements = document.all.tags("DIV");
  779.     for (var index = 0; index < divElements.length; index++)
  780.     {
  781.         el = divElements[index];
  782.         
  783.         dropShadowColor = el.getAttribute("BSSCDropShadowColor");
  784.         if (null != dropShadowColor)
  785.         {
  786.             dropShadowXOffset = el.getAttribute("BSSCDropShadowXOffset");
  787.             if (null == dropShadowXOffset)
  788.                 dropShadowXOffset = 0;
  789.             dropShadowYOffset = el.getAttribute("BSSCDropShadowYOffset");
  790.             if (null == dropShadowYOffset)
  791.                 dropShadowYOffset = 0;
  792.             dropShadowColorName = el.getAttribute("BSSCDropShadowColorName");
  793.             if ("Default" == dropShadowColorName)
  794.                 el.style.filter = "DropShadow(OffX=" + dropShadowXOffset + ", OffY=" + dropShadowYOffset + ")";
  795.             else
  796.                 el.style.filter = "DropShadow(Color=" + dropShadowColor + ", OffX=" + dropShadowXOffset + ", OffY=" + dropShadowYOffset + ")";
  797.         }
  798.     }
  799. }
  800.  
  801. function drop( targetId )
  802.     target = document.all( targetId );
  803.     if (target.style.display == 'none') {
  804.        target.style.display = "" ;
  805.     } else {
  806.        target.style.display = "none";
  807.     }
  808.     event.cancelBubble = true;
  809. }
  810.  
  811. function checkParent(src,dest)
  812. {
  813.     //Search for a specific parent of the current element.
  814.     while(src !=null)
  815.     {
  816.         if(src.tagName == dest)
  817.         {
  818.             return src;
  819.         }
  820.         src = src.parentElement;
  821.     }
  822.     return null;
  823. }
  824.  
  825. //Generic Display code
  826. function outline2()
  827. {
  828.     //Expand or collapse if a list item is clicked.
  829.     var open = event.srcElement;
  830.  
  831.     //Verify that the tag which was clicked was either the 
  832.     //trigger tag or nested within a trigger tag.
  833.     var el = checkParent(open,"CITE");
  834.     if(null != el)
  835.     {    
  836.         var incr=0;
  837.         var elmPos = 0;
  838.         var parentSpan;
  839.         var fBreak
  840.  
  841.         //Get the position of the element which was clicked
  842.         elemPos = window.event.srcElement.sourceIndex;
  843.  
  844.         //Search for a SPAN tag
  845.         for (parentSpan = window.event.srcElement.parentElement; parentSpan!=null;    parentSpan = parentSpan.parentElement) 
  846.         {
  847.             //test if already at a span tag 
  848.             if (parentSpan.tagName=="SPAN") {
  849.                 incr=1;
  850.                 break;
  851.             }
  852.             
  853.             //Test if the tag clicked was in a body tag or in any of the possible kinds of lists
  854.             //we perform this test because nested lists require special handling
  855.             if (parentSpan.tagName=="BODY" || parentSpan.tagName=="UL" || parentSpan.tagName=="OL") 
  856.             {
  857.                 //Determine where the span to be expanded is.  
  858.                 for (incr=1; (elemPos+incr) < document.all.length; incr++)
  859.                 {    
  860.                     //verify we are at an expandable Div tag
  861.                     if(document.all(elemPos+incr).tagName=="SPAN" && (document.all(elemPos+incr).className=="expanded" || document.all(elemPos+incr).className=="glossexpanded" || document.all(elemPos+incr).className=="glosscollapsed" || document.all(elemPos+incr).className=="collapsed"))
  862.                     {
  863.                         fBreak=1;
  864.                         break;
  865.                     }
  866.                     else if(document.all(elemPos+incr).tagName=="LI")
  867.                     {
  868.                         //If the next tag following the list item (li) is another list item(li) return in order to prevent accidentally opening the next span in the list
  869.                         return;
  870.                     }
  871.                 }
  872.             }
  873.             //determine if we need to break out of the while loop (kind of a kludge since theres no goto in javascript)
  874.             if(fBreak==1)
  875.             {
  876.                 break;
  877.             }
  878.         }
  879.     }
  880.     else
  881.     {
  882.         return;
  883.     }
  884.  
  885.     //Now that we've identified the span, expand or collapse it
  886.     if(document.all(elemPos+incr) == null) {    
  887.         return;
  888.     } else if(document.all(elemPos+incr).className=="collapsed") {
  889.         document.all(elemPos+incr).className="expanded";
  890.     } else if(document.all(elemPos+incr).className=="expanded")  {
  891.         document.all(elemPos+incr).className="collapsed";
  892.     } else if(document.all(elemPos+incr).className=="glosscollapsed") {
  893.         document.all(elemPos+incr).className="glossexpanded";
  894.     } else if(document.all(elemPos+incr).className=="glossexpanded") {
  895.         document.all(elemPos+incr).className="glosscollapsed";
  896.     } else    {
  897.         return;
  898.     }
  899.     event.cancelBubble = true;
  900. }
  901.  
  902.  
  903. //////////BSSCDHTML Section 2//////////
  904.  
  905. function RemoveNavBar()
  906. {
  907.     // See if we are in a popup and if so remove the NavBar
  908.     if (BSSCPopup_IsPopup()) {
  909.  
  910.         if (gbIE4) {
  911.             var tempColl = document.all.tags("DIV");
  912.             for (var iDiv = 0; iDiv < tempColl.length; iDiv++) {
  913.                 if (tempColl(iDiv).id == "NavBar") {
  914.                     tempColl(iDiv).style.visibility = gBsStyVisHide;
  915.                     if (gbIE5) {
  916.                         tempColl(iDiv).style.position = "absolute";
  917.                     }
  918.                     tempColl(iDiv).style.pixelTop = "-100px";
  919.                     break;
  920.                 }
  921.             }
  922.         } else if (gbNav4) {
  923.             for (var iLayer = 0; iLayer < document.layers.length; iLayer++) {
  924.                 if (document.layers[iLayer].id == "NavBar") {
  925.                     document.layers[iLayer].visibility = gBsStyVisHide;
  926.                 }
  927.             }
  928.             if ((document.images.length > 0) && (document.images[0].src.indexOf('bsscnav1.gif') != -1)) {
  929.                 document.links[0].href = "javascript:void(null);";
  930.             }
  931.         }
  932.     }
  933.     
  934.     return;
  935. }
  936.  
  937.  
  938.  
  939. //////////////////////////////////////////////////////////////////////////////////////////////
  940. //
  941. //    Begin DHTML Popup Functions
  942. //
  943. //////////////////////////////////////////////////////////////////////////////////////////////
  944. //variables used to isolate the browser type
  945. var gBsDoc            = null;            
  946. var gBsSty            = null;
  947. var gBsHtm            = null;
  948. var gBsStyVisShow    = null;
  949. var gBsStyVisHide    = null;
  950. var gBsClientWidth    = 640;
  951. var gBsClientHeight = 480;
  952. var gBsBrowser        = null;
  953.  
  954. // here is the varible for judge popup windows size. these parameter is for IE5.0, it may need adjust for others.
  955. var gBRateH_W        = 0.618; // 1.618 Golden cut.
  956. var gBMaxXOfParent    = 0.8; 
  957. var gBMaxYOfParent    = 0.8;
  958. var gBscrollHeight   = 16;
  959. var gBscrollWidth   =  16;
  960. var gBpermitXDelta    = 3;
  961. var gBpermitYDelta    = 3;
  962.  
  963.  
  964.  
  965. //the browser information itself
  966. function _BSPSBrowserItself()
  967. {
  968.     var agent  = navigator.userAgent.toLowerCase();
  969.     this.major = parseInt(navigator.appVersion);
  970.     this.minor = parseFloat(navigator.appVersion);
  971.     this.ns    = ((agent.indexOf('mozilla') != -1) && ((agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1)));
  972.     this.ns2   = ((this.ns) && (this.major == 2));
  973.     this.ns3   = ((this.ns) && (this.major == 3));
  974.     this.ns4   = ((this.ns) && (this.major >= 4));
  975.     this.ie       = (agent.indexOf("msie") != -1);
  976.     this.ie3   = ((this.ie) && (this.major == 2));
  977.     this.ie4   = ((this.ie) && (this.major >= 4));
  978.     this.op3   = (agent.indexOf("opera") != -1);
  979.  
  980.     if (this.ns4)
  981.     {
  982.         gBsDoc        = "document";
  983.         gBsSty        = "";
  984.         gBsHtm        = ".document";
  985.         gBsStyVisShow    = "show";
  986.         gBsStyVisHide    = "hide";
  987.  
  988.     }
  989.     else if (this.ie4)
  990.     {
  991.         gBsDoc         = "document.all";
  992.         gBsSty         = ".style";
  993.         gBsHtm         = "";
  994.         gBsStyVisShow    = "visible";
  995.         gBsStyVisHide    = "hidden";
  996.     }
  997. }
  998.  
  999. //Here is the browser type 
  1000. function _BSPSGetBrowserInfo()
  1001. {
  1002.     gBsBrowser    = new _BSPSBrowserItself();
  1003. }
  1004.  
  1005. //Get client size info
  1006. function _BSPSGetClientSize()
  1007. {
  1008.     if (gBsBrowser.ns4)
  1009.     {
  1010.         gBsClientWidth    = innerWidth;
  1011.         gBsClientHeight = innerHeight;
  1012.  
  1013.     }
  1014.     else if (gBsBrowser.ie4)
  1015.     {
  1016.         gBsClientWidth    = document.body.clientWidth;
  1017.         gBsClientHeight = document.body.clientHeight;
  1018.     }
  1019. }
  1020.  
  1021.  
  1022. var gstrPopupID = 'BSSCPopup';
  1023. var gstrPopupShadowID = 'BSSCPopupShadow';
  1024. var gstrPopupTopicID = 'BSSCPopupTopic';
  1025. var gstrPopupIFrameID = 'BSSCPopupIFrame';
  1026. var gstrPopupIFrameName = 'BSSCPopupIFrameName';
  1027.  
  1028. var gstrPopupSecondWindowName = 'BSSCPopup';
  1029.  
  1030. var    gPopupDiv = null;
  1031. var gPopupDivStyle = null;
  1032. var    gPopupShadow = null;
  1033. var    gPopupTopic = null;
  1034. var gPopupIFrame = null;
  1035. var gPopupIFrameStyle = null;
  1036. var gPopupWindow = null;
  1037. var gnPopupClickX = 0;
  1038. var gnPopupClickY = 0;
  1039.  
  1040. var gnPopupScreenClickX = 0;
  1041. var gnPopupScreenClickY = 0;
  1042.  
  1043. var gbPopupTimeoutExpired = false;
  1044.  
  1045. var gbScriptName = "EHELP_DHTM";
  1046. var gbPathofJS = "";
  1047.  
  1048.  
  1049. if (gbIE4) {
  1050.     var aScripts = document.scripts;
  1051.     var aScript = null;
  1052.     var i = 0;
  1053.     for (i = 0; i < aScripts.length ; i ++ )
  1054.     {
  1055.         if (aScripts[i].name == gbScriptName) {
  1056.             aScript = aScripts[i];
  1057.             break;
  1058.         }
  1059.         
  1060.     }
  1061.  
  1062.     if (aScript != null) {
  1063.         var nPathPos = 0;
  1064.         var strCurrentSrc = "";
  1065.         strCurrentSrc = aScript.src;
  1066.         var nPathPos1 = strCurrentSrc.lastIndexOf("\\");
  1067.         var nPathPos2 = strCurrentSrc.lastIndexOf("/");
  1068.         if (nPathPos1 > nPathPos2)
  1069.             nPathPos = nPathPos1 + 1;
  1070.         else
  1071.             nPathPos = nPathPos2 + 1;
  1072.  
  1073.         gbPathofJS = strCurrentSrc.substring(0, nPathPos);
  1074.     }
  1075. }
  1076.  
  1077. // Replace point - Used by SingleSource 
  1078. // var gbBlankPageForIFrame = gbPathofJS + "_blank.htm";
  1079. var gbBlankPageForIFrame = "about:blank";
  1080.  
  1081. if (BSSCPopup_IsPopup()) {
  1082.     document.write("<base target=\"_parent\">");
  1083. }
  1084.  
  1085. function DHTMLPopupSupport()
  1086. {
  1087.     if ((gbIE4) && (!gbMac)) {
  1088.         return true;
  1089.     }
  1090.     return false;
  1091. }
  1092.  
  1093.  
  1094.  
  1095. function BSSCPopup_IsPopup()
  1096. {
  1097.     if (DHTMLPopupSupport() && (this.name == gstrPopupIFrameName)) {
  1098.         return true;
  1099.     } else if ((gbNav4 || gbIE4) && (this.name == gstrPopupID)) {
  1100.         return true;
  1101.     } else {
  1102.         return false;
  1103.     }
  1104. }
  1105.  
  1106. function _BSSCCreatePopupDiv()
  1107. {
  1108.     if (gPopupDiv == null) {
  1109.         if (DHTMLPopupSupport()) {
  1110.             document.write("<DIV ID='" + gstrPopupID + "' STYLE='position:absolute; width:0; height:0; top:-100; left:0; z-index:600; visibility:hidden;'>");
  1111.             document.write("<DIV ID='" + gstrPopupShadowID + "' STYLE=\"position:absolute;top:0; left:0;  width:0; height:0; background-color:#C0C0C0;\"></DIV>");
  1112.             document.write("<DIV ID='" + gstrPopupTopicID + "' STYLE=\"position:absolute;top:0; left:0;  width:0; height:0; background-color:#FFFFFF;border:1px #000000 outset;\">");
  1113.             document.write("<IFRAME ID='" + gstrPopupIFrameID + "' name='" + gstrPopupIFrameName + "' src = '" + gbBlankPageForIFrame + "' frameborder=0 scrolling=auto></IFRAME>");
  1114.             document.write("</DIV></DIV>");
  1115.             var tempColl = document.all.tags("DIV");
  1116.             for (var iDiv = 0; iDiv < tempColl.length; iDiv++) {
  1117.                 if (tempColl(iDiv).id == gstrPopupID) {
  1118.                     gPopupDiv = tempColl(iDiv);
  1119.                 }
  1120.                 if (tempColl(iDiv).id == gstrPopupShadowID) {
  1121.                     gPopupShadow = tempColl(iDiv);
  1122.                 }
  1123.                 if (tempColl(iDiv).id == gstrPopupTopicID) {
  1124.                     gPopupTopic = tempColl(iDiv);
  1125.                 }
  1126.             }
  1127.             
  1128.             gPopupIFrame = eval("gPopupDiv.document.frames['" + gstrPopupIFrameName + "']");
  1129.             gPopupDivStyle = eval("gPopupDiv" + gBsSty);
  1130.             gPopupIFrameStyle = eval(gBsDoc + "['" + gstrPopupIFrameName + "']" + gBsSty);
  1131.         }
  1132.     }
  1133. }
  1134.  
  1135. function BSSCPopup_Timeout()
  1136. {
  1137.     if ((gPopupIFrame.document.readyState == "complete") &&
  1138.         (gPopupIFrame.document.body != null) && 
  1139.         (gPopupIFrame.location.href.indexOf(gbBlankPageForIFrame) == -1)) {
  1140.         BSSCPopup_TimeoutReal();
  1141.     } else {
  1142.         setTimeout("BSSCPopup_Timeout()", 100);
  1143.     }
  1144. }
  1145.  
  1146. function BSSCPopup_TimeoutReal()
  1147. {
  1148.     window.gbPopupTimeoutExpired = true;
  1149.  
  1150.     if (gPopupIFrame.document) {
  1151.         BSSCPopup_ChangeTargettoParent(gPopupIFrame.document);
  1152.         gPopupIFrame.document.body.onclick = BSSCPopupClicked;
  1153.     }
  1154.     document.onmousedown = BSSCPopupParentClicked;
  1155. }
  1156.  
  1157. function BSSCPopup_ChangeTargettoParent(tagsObject)
  1158. {
  1159.     var collA = tagsObject.all.tags("A");
  1160.     var j = 0;
  1161.     if (collA != null) {
  1162.         for (j = 0; j < collA.length; j ++ )
  1163.         {
  1164.             collA[j].target = "_parent";
  1165.         }
  1166.  
  1167.     }
  1168. }
  1169.  
  1170. function BSPSPopupTopicWinHelp(strURL)
  1171. {
  1172.     _BSSCPopup(strURL);
  1173.     return;
  1174. }
  1175.  
  1176. function _BSSCPopup(strURL)
  1177. {
  1178.     if (DHTMLPopupSupport()) {
  1179.  
  1180.         // If we are already in a popup, replace the contents
  1181.         if (BSSCPopup_IsPopup()) {
  1182.  
  1183.             location.href = strURL;
  1184.             parent.window.gbPopupTimeoutExpired = false;
  1185.             if (gbMac) {
  1186.                 setTimeout("BSSCPopup_AfterLoad('" + strURL + "')", 400);
  1187.             } else {
  1188.                 setTimeout("BSSCPopup_AfterLoad('" + strURL + "')", 100);
  1189.             }
  1190.             
  1191.         } else {
  1192.  
  1193.             // Load the requested URL into the IFRAME
  1194.             gPopupIFrame.location.href = strURL;
  1195.             window.gbPopupTimeoutExpired = false;
  1196.             if (gbMac) {
  1197.                 setTimeout("BSSCPopup_AfterLoad('" + strURL + "')", 400);
  1198.             } else {
  1199.                 setTimeout("BSSCPopup_AfterLoad('" + strURL + "')", 100);
  1200.             }
  1201.         }
  1202.  
  1203.     } else {
  1204.         _BSSCPopup2(strURL);
  1205.     }
  1206.     return;
  1207. }
  1208.  
  1209.  
  1210. function _BSSCPopup2(strURL)
  1211. {
  1212.     if (window.name == gstrPopupSecondWindowName) {
  1213.         window.location = strURL;
  1214.     } else {
  1215.  
  1216.         BSSCHidePopupWindow();
  1217.         var nX = 0;
  1218.         var nY = 0;
  1219.         var nHeight = 300;
  1220.         var nWidth = 400;
  1221.         _BSPSGetClientSize();
  1222.         if (gBsBrowser.ns4) {
  1223.             nX = window.screenX + (window.outerWidth - window.innerWidth) + window.gnPopupClickX;
  1224.             nY = window.screenY + (window.outerHeight - window.innerHeight) + window.gnPopupClickY;
  1225.             if (nY + nHeight + 40 > screen.availHeight) {
  1226.                 nY = screen.availHeight - nHeight - 40;
  1227.             }
  1228.             if (nX + nWidth + 40 > screen.availWidth) {
  1229.                 nX = screen.availWidth - nWidth - 40;
  1230.             }
  1231.         } else {
  1232.             nX = window.gnPopupScreenClickX;
  1233.             nY = window.gnPopupScreenClickY;
  1234.         }
  1235.  
  1236.         // Launch a separate window
  1237.         var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes";
  1238.         if (gBsBrowser.ns) {
  1239.             strParam += ",OuterHeight=" + nHeight + ",OuterWidth=" + nWidth;
  1240.             strParam += ",screenX=" + nX + ",screenY=" + nY;
  1241.             strParam += ",dependent=yes";
  1242.         }
  1243.         else {
  1244.             strParam += ",height=" + nHeight + ",width=" + nWidth;
  1245.             strParam += ",left=" + nX + ",top=" + nY;
  1246.         }
  1247.         window.gPopupWindow = window.open(strURL, gstrPopupSecondWindowName, strParam);
  1248.         if (gBsBrowser.ns4) {
  1249.             window.gPopupWindow.captureEvents(Event.CLICK | Event.BLUE);
  1250.             window.gPopupWindow.onclick = NonIEPopup_HandleClick;
  1251.             window.gPopupWindow.onblur = NonIEPopup_HandleBlur;
  1252.         }
  1253.         else if (gBsBrowser.ie4)
  1254.         {
  1255.             window.gPopupWindow.focus();
  1256.         }
  1257.     }
  1258.     return;
  1259. }
  1260.  
  1261. function NonIEPopup_HandleBlur(e)
  1262. {
  1263.     window.gPopupWindow.focus();
  1264. }
  1265.  
  1266. function NonIEPopup_HandleClick(e)
  1267. {
  1268.     // Because navigator will give the event to the handler before the hyperlink, let's
  1269.     // first route the event to see if we are clicking on a Popup menu in a popup.
  1270.     document.routeEvent(e);
  1271.  
  1272.     // If a popup menu is active then don't do anything with the click
  1273.     if (window.gPopupWindow.gbInPopupMenu) {
  1274.         window.gPopupWindow.captureEvents(Event.CLICK);
  1275.         window.gPopupWindow.onclick = NonIEPopup_HandleClick;
  1276.         return false;
  1277.     }
  1278.  
  1279.     // Close the popup window
  1280.     if (e.target.href != null) {
  1281.         window.location.href = e.target.href;
  1282.         if (e.target.href.indexOf("BSSCPopup") == -1) {
  1283.             this.close();
  1284.         }
  1285.     } else {
  1286.         this.close();
  1287.     }
  1288.     return false;
  1289. }
  1290.  
  1291. function BSSCPopup_AfterLoad(strURL)
  1292. {    
  1293.     if (typeof(window.gPopupIFrame.document) == "unknown") {
  1294.         _BSSCPopup2(strURL);
  1295.         return;
  1296.     }
  1297.     if ((window.gPopupIFrame.document.readyState == "complete") &&
  1298.         (window.gPopupIFrame.document.body != null) && 
  1299.         (window.gPopupIFrame.location.href.indexOf(gbBlankPageForIFrame) == -1)) {
  1300.         BSSCPopup_ResizeAfterLoad(strURL);
  1301.     }  else {
  1302.         setTimeout("BSSCPopup_AfterLoad('" + strURL + "')", 200);
  1303.     }
  1304. }
  1305.  
  1306.  
  1307. function BSSCPopup_ResizeAfterLoad(strURL)
  1308. {
  1309.     window.gPopupDivStyle.visibility = gBsStyVisHide;
  1310.  
  1311.     // Determine the width and height for the window
  1312.     //var size = new BSSCSize(0, 0);
  1313.     //BSSCGetContentSize(window.gPopupIFrame, size);
  1314.     //var nWidth = size.x;
  1315.     //var nHeight = size.y;
  1316.  
  1317.  
  1318.     _BSPSGetClientSize();
  1319.  
  1320.     var size = new BSSCSize(0, 0);
  1321.  
  1322.     BSSCGetContentSize(window.gPopupIFrame, size);
  1323.  
  1324.     // Determine the width and height for the window
  1325.     var nWidth = size.x;
  1326.     var nHeight = size.y;
  1327.         
  1328.     window.gPopupDivStyle.width = nWidth;
  1329.     window.gPopupDivStyle.height = nHeight;
  1330.  
  1331.     // Determine the position of the window
  1332.     var nClickX = window.gnPopupClickX;
  1333.     var nClickY = window.gnPopupClickY;
  1334.     var nTop = 0;
  1335.     var nLeft = 0;
  1336.  
  1337.     if (nClickY + nHeight + 20 < gBsClientHeight + document.body.scrollTop) {
  1338.         nTop = nClickY + 10;
  1339.     } else {
  1340.         nTop = (document.body.scrollTop + gBsClientHeight) - nHeight - 20;
  1341.     }
  1342.     if (nClickX + nWidth < gBsClientWidth + document.body.scrollLeft) {
  1343.         nLeft = nClickX;
  1344.     } else {
  1345.         nLeft = (document.body.scrollLeft + gBsClientWidth) - nWidth - 8;
  1346.     }
  1347.     
  1348.     if (nTop < document.body.scrollTop ) nTop  = document.body.scrollTop + 1;
  1349.     if (nLeft< document.body.scrollLeft) nLeft = document.body.scrollLeft + 1;
  1350.  
  1351.  
  1352.     window.gPopupDivStyle.left = nLeft;
  1353.     window.gPopupDivStyle.top = nTop;
  1354.  
  1355.     // Set the location of the background blocks
  1356.     window.gPopupShadow.style.left = 6;
  1357.     window.gPopupShadow.style.top = 6;
  1358.     if (gbIE55)
  1359.     {
  1360.         window.gPopupShadow.style.left = 4;
  1361.         window.gPopupShadow.style.top = 4;
  1362.     }
  1363.     window.gPopupShadow.style.width = nWidth;
  1364.     window.gPopupShadow.style.height = nHeight;
  1365.     window.gPopupTopic.style.width = nWidth;
  1366.     window.gPopupTopic.style.height = nHeight;
  1367.     if (gbIE55)
  1368.     {
  1369.         window.gPopupShadow.style.width = nWidth + 2;
  1370.         window.gPopupShadow.style.height = nHeight + 2;
  1371.         window.gPopupTopic.style.width = nWidth + 2;
  1372.         window.gPopupTopic.style.height = nHeight + 2;
  1373.     }
  1374.  
  1375.  
  1376.     if (gbMac) {
  1377.         // Total hack on the iMac to get the IFrame to position properly
  1378.         window.gPopupIFrameStyle.pixelLeft = 100;
  1379.         window.gPopupIFrameStyle.pixelLeft = 0;
  1380.         // Explicitly call BSSCOnLoad because the Mac doesn't seem to do it
  1381.         window.gPopupIFrame.window.BSSCOnLoad();
  1382.     }
  1383.     //var nOriWidth = window.gPopupIFrameStyle.width
  1384.  
  1385.     window.gPopupIFrameStyle.width = nWidth;
  1386.     window.gPopupIFrameStyle.height = nHeight;
  1387.     if (gbIE55)
  1388.     {
  1389.         window.gPopupIFrameStyle.top = 0;
  1390.         window.gPopupIFrameStyle.left = 0;
  1391.     }
  1392.  
  1393.     gPopupIFrame.location.href = strURL;  // reload again, this will fix the bookmark misunderstand in IE5.
  1394.     window.gPopupDivStyle.visibility = gBsStyVisShow;
  1395.  
  1396.     setTimeout("BSSCPopup_Timeout();", 100);
  1397.     
  1398.     return false;
  1399. }
  1400.  
  1401.  
  1402. function    BSSCSize(x, y)
  1403. {
  1404.     this.x = x;
  1405.     this.y = y;
  1406. }
  1407.  
  1408. function BSSCGetContentSize(thisWindow, size)
  1409. {
  1410.     if (!((gBsBrowser.ie4) || (gBsBrowser.ns4)))
  1411.         return;
  1412.  
  1413.     if (gbMac) {
  1414.         size.x = 300;
  1415.         size.y = 300;
  1416.         return;
  1417.     }
  1418.  
  1419.     // Resize the width until it is wide enough to handle the content
  1420.     // The trick is to start wide and determine when the scrollHeight changes
  1421.     // because then we know a scrollbar is necessary. We can then go back
  1422.     // to the next widest size (for no scrollbar)
  1423.  
  1424.     var ClientRate = gBsClientHeight / gBsClientWidth;
  1425.  
  1426.     var GoldenSize = new BSSCSize(0,0);
  1427.     GoldenSize.x = gBsClientWidth * gBMaxXOfParent;
  1428.     GoldenSize.y = gBsClientHeight *gBMaxYOfParent ;
  1429.  
  1430.     if (ClientRate > gBRateH_W) {
  1431.         GoldenSize.y = GoldenSize.x * gBRateH_W;
  1432.     }
  1433.     else {
  1434.         GoldenSize.x = GoldenSize.y / gBRateH_W;
  1435.     }
  1436.  
  1437.     // Try to using parent specified max x.
  1438.     var x = 0;
  1439.     var maxgoldx = GoldenSize.x;
  1440.     var maxx = gBsClientWidth * gBMaxXOfParent;
  1441.     
  1442.     // This double resize causes the document to re-render (and we need it to)
  1443.     thisWindow.moveTo(10000,10000); // this is used to fix the flash on IE4.
  1444.     thisWindow.resizeTo(1, 1);
  1445.     thisWindow.resizeTo(1, 1);
  1446.     thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);
  1447.     thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);
  1448.         
  1449.     var miny = thisWindow.document.body.scrollHeight + gBscrollHeight;
  1450.     
  1451.     if (miny > GoldenSize.y) // the popup does not fix in the parent wanted golden area. so try to expand itself as large as it can
  1452.     {
  1453.         thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);
  1454.         thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);
  1455.         
  1456.         miny =     thisWindow.document.body.scrollHeight + gBscrollHeight;
  1457.         maxy = gBsClientHeight * gBMaxYOfParent;
  1458.         
  1459.         if (miny > maxy) { // the popup must have a scroll, OK let it be.
  1460.             miny = maxy;
  1461.             size.x = maxx;
  1462.             size.y = maxy;
  1463.         }
  1464.         else { // popup still can fit in the parent area by someway. now we choose the same h/w rate as parent.
  1465.             size.y = miny;
  1466.             
  1467.             //  downsize from maxx , now I try to using binary divide.
  1468.             x = maxx;
  1469.             deltax = -maxx/2;
  1470.             //j = 0;
  1471.             while (true) {
  1472.                 x = x + deltax;
  1473.                 thisWindow.resizeTo(x, miny);
  1474.                 thisWindow.resizeTo(x, miny);
  1475.                 diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * ClientRate;
  1476.                 if (diffy >  gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
  1477.                     deltax = Math.abs(deltax) /2;
  1478.                 else if (diffy <  -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
  1479.                     deltax = -Math.abs(deltax) /2;
  1480.                 else 
  1481.                     // the y is close enough to wanted.
  1482.                     break;
  1483.                 if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
  1484.                     break;
  1485.                 //j ++;
  1486.                 
  1487.             }
  1488.             size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;
  1489.             size.y = thisWindow.document.body.scrollHeight;// + gBscrollHeight;    
  1490.             thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little.
  1491.             
  1492.         // Handle absurd cases just in case IE flakes
  1493.     //        if (size.y < 100) {
  1494.     //            size.y = 100;
  1495.     //        }
  1496.         }
  1497.     }
  1498.     else {
  1499.         //  downsize from maxgoldx , now I try to using binary divide.
  1500.         x = maxgoldx;
  1501.         deltax = -maxgoldx/2;
  1502.         //i = 0;
  1503.         while (true) {
  1504.             x = x + deltax;
  1505.             thisWindow.resizeTo(x, miny);
  1506.             thisWindow.resizeTo(x, miny);
  1507.             diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * gBRateH_W;
  1508.             if (diffy >  gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
  1509.                 deltax = Math.abs(deltax) /2;
  1510.             else if (diffy <  -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
  1511.                 deltax = -Math.abs(deltax) /2;
  1512.             else 
  1513.                 // the y is close enough to wanted.
  1514.                 break;
  1515.             if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
  1516.                 break;
  1517.             //i ++;
  1518.                 
  1519.         }
  1520.         size.x = thisWindow.document.body.scrollWidth ;//+ gBscrollWidth;
  1521.         size.y = thisWindow.document.body.scrollHeight ;//+ gBscrollHeight;    
  1522.         thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little.
  1523.     }
  1524.  
  1525.     if ((gbIE4) && (!gbIE5))
  1526.     {
  1527.         size.x = size.x + 16;    //reserve a width for scrollbar (IE 4.0 only)
  1528.     }
  1529.  
  1530.     thisWindow.resizeTo(size.x, size.y);
  1531.     thisWindow.resizeTo(size.x, size.y);
  1532.  
  1533.     return;
  1534. }
  1535.  
  1536.  
  1537.  
  1538. function BSSCPopupParentClicked()
  1539. {
  1540.     BSSCPopupClicked();
  1541.     return;
  1542. }
  1543.  
  1544.  
  1545. function BSSCPopupClicked()
  1546. {
  1547.     if (!window.gbPopupTimeoutExpired) {
  1548.         return false;
  1549.     }
  1550.  
  1551.     if (gPopupIFrame.window.gbInPopupMenu) {
  1552.         return false;
  1553.     }
  1554.  
  1555.     // Give the user a message about javascript calls through objects.
  1556.     if ((gPopupIFrame.window.event != null) &&
  1557.         (gPopupIFrame.window.event.srcElement != null) &&
  1558.         (gPopupIFrame.window.event.srcElement.tagName == "A") &&
  1559.         (gPopupIFrame.window.event.srcElement.href.indexOf("javascript:") == 0) &&
  1560.         (gPopupIFrame.window.event.srcElement.href.indexOf(".") != -1)) {
  1561.         gPopupIFrame.window.event.cancelBubble = true;
  1562.         alert('Hyperlinks to objects do not work in popups.');
  1563.         return false;
  1564.     }
  1565.  
  1566.     if (gPopupIFrame.document) {
  1567.         gPopupIFrame.document.body.onclick = null;
  1568.     }
  1569.     document.onclick = null;
  1570.     document.onmousedown = null;
  1571.  
  1572.     // Simply hide the popup
  1573.     gPopupDivStyle.visibility = gBsStyVisHide;
  1574.     gPopupIFrame.location.href = gbBlankPageForIFrame;
  1575.  
  1576.     return true;
  1577. }
  1578.  
  1579.  
  1580. //trace the mouse over's position for hotspot
  1581. function  BSPSPopupOnMouseOver(event)
  1582. {
  1583.     if (gBsBrowser.ie4) {
  1584.         window.gnPopupClickX = event.clientX + document.body.scrollLeft;
  1585.         window.gnPopupClickY = event.clientY + document.body.scrollTop;
  1586.         window.gnPopupScreenClickX = event.screenX;
  1587.         window.gnPopupScreenClickY = event.screenY;
  1588.     } else if (gBsBrowser.ns4) {
  1589.         window.gnPopupClickX = event.pageX;
  1590.         window.gnPopupClickY = event.pageY;
  1591.     }
  1592. }
  1593.  
  1594. function BSSCHidePopupWindow()
  1595. {
  1596.     if (window.gPopupWindow != null) {
  1597.         if (gBsBrowser.ns4) {
  1598.             if ((typeof window.gPopupWindow != "undefined") && (!window.gPopupWindow.closed)) {
  1599.                 window.gPopupWindow.close();
  1600.                 window.gPopupWindow = null;
  1601.             }
  1602.         }
  1603.     }
  1604.  
  1605.     return;
  1606. }
  1607.  
  1608. var gbPopupMenuTimeoutExpired = false;
  1609. var gbInPopupMenu = false;
  1610. var gbPopupMenuTopicList = null;
  1611.  
  1612. //////////////////////////////////////////////////////////////////////////////////////////
  1613. //
  1614. // Popup Menu code
  1615. //
  1616. //////////////////////////////////////////////////////////////////////////////////////////
  1617.  
  1618.  
  1619. function _WritePopupMenuLayer()
  1620. {
  1621.     if (gbNav4) {
  1622. //Do not try to write ininle styles for NS!  NS can not handle it and will not stop downloading the html page...
  1623.        document.write("<DIV CLASS='WebHelpPopupMenu' ID='PopupMenu'></DIV>");
  1624.     } else {
  1625.          document.write("<DIV ID='PopupMenu' STYLE='position:absolute; left:0px; top:0px; z-index:4; visibility:hidden;'></DIV>");
  1626.            if (gbIE4) {
  1627.         document.write("<STYLE TYPE='text/css'>");
  1628.         if (gbMac) {
  1629.             document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:10pt; text-decoration:none;}");
  1630.             document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:10pt; text-decoration:none;}");
  1631.         } else {
  1632.             document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:8pt; text-decoration:none;}");
  1633.             document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:8pt; text-decoration:none;}");
  1634.         }
  1635.         document.write("</STYLE>");
  1636.            }
  1637.     }
  1638. }
  1639.  
  1640. //Define variable arguments as: strTitle, strUrl
  1641. function PopupMenuTopicEntry() 
  1642. {
  1643.     this.strTitle = PopupMenuTopicEntry.arguments[0];
  1644.     this.strURL = PopupMenuTopicEntry.arguments[1];
  1645. }
  1646.  
  1647. // If the topic list is set, it is an array of TopicEntry objects (defined in WebHelp3.js)
  1648. function PopupMenu_SetTopicList(aPopupTopicArray)
  1649. {
  1650.     gbPopupMenuTopicList = aPopupTopicArray;
  1651. }
  1652.  
  1653. //Seek for the bsscright frame 
  1654. function _SeekFrameByName( cRoot, strName )
  1655. {
  1656.     if( cRoot == null )    return null;
  1657.     if( cRoot.frames == null )    return null;
  1658.     if( cRoot.frames[strName] != null )    return cRoot.frames[strName];
  1659.     for (var i=0; i<cRoot.frames.length; i++)
  1660.     {
  1661.         var cObj = _SeekFrameByName( cRoot.frames(i).document, strName );
  1662.         if( cObj != null )        return cObj;
  1663.     };
  1664.     return null;
  1665. }
  1666. function _GetFrameByName( cRoot, strName )
  1667. {
  1668.     if( cRoot == null )    return null;
  1669.     var cRet = _SeekFrameByName(cRoot, strName);
  1670.     if( cRet != null )    return cRet;
  1671.     return _GetFrameByName( cRoot.parent, strName );
  1672. }
  1673.  
  1674. function _PopupMenu_Invoke(fn_arguments)
  1675. {
  1676.     if ((!gbIE4 && !gbNav4) || ((gbMac) && (gbIE4) && (window.event.srcElement.tagName == "AREA"))) {
  1677.     
  1678.         var argLen     = fn_arguments.length;
  1679.  
  1680.         // Create the window that the hyperlinks will go into
  1681.         var nHeight = argLen * 15;
  1682.         var nWidth = 400;
  1683.         var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
  1684.         strParam += ",height=" + nHeight + ",width=200";
  1685.         strParam += ",resizable";
  1686.  
  1687.         // Create a temporary window first to ensure the real popup comes up on top
  1688.         var wndTemp = window.open("", "temp", strParam);
  1689.  
  1690.         // Create the real popup window
  1691.         var wndPopupLinks = window.open("", "popuplinks", strParam);
  1692.  
  1693.         // Close the temporary
  1694.         wndTemp.close();
  1695.  
  1696.         wndPopupLinks.document.open("text/html");
  1697.         wndPopupLinks.document.write("<html><head></head>");
  1698.         wndPopupLinks.document.write("<body onBlur=\'self.focus();\'>");
  1699.         var strParaLine = "";
  1700.         for (var i = 0; i < (argLen - 2) / 2; i++) {
  1701.             strParaLine = "";
  1702.             strParaLine += "<a href=\"javascript:";
  1703.             if (gbIE) {
  1704.                 strParaLine += "onBlur=null; ";
  1705.             }
  1706.             strParaLine += "opener.location=\'";
  1707.             strParaLine += fn_arguments[2 * i + 3];
  1708.             strParaLine += "\';close();\"";
  1709.             if (fn_arguments[1] != '') {
  1710.                 strParaLine += " TARGET='" + fn_arguments[1] + "'";
  1711.             }
  1712.             strParaLine += ">";
  1713.             strParaLine += fn_arguments[2 * i + 2];
  1714.             strParaLine += "</a>";
  1715.             strParaLine += "<br>";
  1716.             wndPopupLinks.document.write(strParaLine);
  1717.         }
  1718.         wndPopupLinks.document.write("</body></html>");
  1719.         wndPopupLinks.document.close();
  1720.         window.gbInPopupMenu = true;
  1721.         if (!gbIE) {
  1722.             wndPopupLinks.focus();
  1723.         }
  1724.  
  1725.         return false;
  1726.     }
  1727.  
  1728.     // Make sure we have reasonable arguments
  1729.     var argLen = fn_arguments.length;
  1730.     if (argLen < 3) {
  1731.         return false;
  1732.     }
  1733.  
  1734.     // Check to see if we only have one target
  1735.     var strTarget = "";
  1736.     if (((argLen < 5) && ((isNaN(fn_arguments[2])) || (gbPopupMenuTopicList == null))) ||
  1737.         ((argLen < 4) && ((!isNaN(fn_arguments[2])) && (gbPopupMenuTopicList != null)))) {
  1738.  
  1739.         // Get the place that we will be putting the topic into
  1740.         var targetDoc = null;
  1741.         if (fn_arguments[1] == '') {
  1742.             targetDoc = window.document;
  1743.         } else {
  1744.             targetDoc = _GetFrameByName( parent, fn_arguments[1] );
  1745.             if (targetDoc == null) {
  1746.                 targetDoc  = window.document;
  1747.             }
  1748.             //if (gbIE4) {
  1749.             //        targetDoc = eval("top.document.frames['" + fn_arguments[1] + "']");
  1750.             //    } else if (gbNav4) {
  1751.             //    targetDoc = eval("window.top." + fn_arguments[1] + ".document");
  1752.             //}
  1753.             strTarget = "TARGET='" + fn_arguments[1] + "'";
  1754.         }
  1755.         if (isNaN(fn_arguments[2]) ||  (gbPopupMenuTopicList == null)) {
  1756.             targetDoc.location.href = fn_arguments[3];
  1757.         } else {
  1758.             targetDoc.location.href = gbPopupMenuTopicList[fn_arguments[2]].strURL;
  1759.         }
  1760.         return false;
  1761.     }
  1762.     
  1763.     var strMenu = "";
  1764.     if (gbNav4) {
  1765.         strMenu = '<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=3 BGCOLOR="#c0c0c0">';
  1766.     } else {
  1767.         strMenu = '<TABLE STYLE="border:2px outset white;" CELLSPACING=0';
  1768.         if (gbMac) {
  1769.             strMenu += ' CELLPADDING=4';
  1770.         } else {
  1771.             strMenu += ' CELLPADDING=2';
  1772.         }    
  1773.         strMenu += ' BGCOLOR=#c0c0c0>';
  1774.     }
  1775.  
  1776.     // Add each of the items
  1777.     var i = 2;
  1778.     while (i <= argLen - 1) {
  1779.         strMenu += '<TR><TD><NOBR>'
  1780.         // If the destination is a number then look it up in the topic list
  1781.         if (isNaN(fn_arguments[i]) ||  (gbPopupMenuTopicList == null)) {
  1782.             strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + fn_arguments[i + 1] + '"' + strTarget;
  1783.         } else {
  1784.             strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + gbPopupMenuTopicList[fn_arguments[i]].strURL + '"' + strTarget;
  1785.         }
  1786.         strMenu += ' onclick="PopupMenu_HandleClick(event);"';
  1787.         strMenu += ' onmouseover="PopupMenu_Over(event);"';
  1788.         strMenu += ' onmouseout="PopupMenu_Out(event);"';
  1789.         strMenu += '>';
  1790.         if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
  1791.             strMenu += '<SPAN CLASS="PopupNotOver">' + fn_arguments[i] + '</SPAN>';
  1792.         } else {
  1793.             strMenu += '<SPAN CLASS="PopupNotOver">' + gbPopupMenuTopicList[fn_arguments[i]].strTitle + '</SPAN>';
  1794.         }
  1795.         strMenu += '</A></DIV></NOBR></TD></TR>';
  1796.  
  1797.         if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
  1798.             i += 2;
  1799.         } else {
  1800.             i += 1;
  1801.         }
  1802.     }
  1803.     strMenu += "</TABLE>";
  1804.  
  1805.     if (gbMac) {
  1806.     // totally hack. because ie5 in mac need something. </TABLE> is one of them. mac is mad.
  1807.         strMenu +="<TABLE></TABLE>";
  1808.     }
  1809.  
  1810.     var layerPopup = null;
  1811.     var stylePopup = null;
  1812.     var nEventX = 0;
  1813.     var nEventY = 0;
  1814.     var nWindowWidth = 0;
  1815.     if (gbIE4) {
  1816.  
  1817.         layerPopup = document.all["PopupMenu"];
  1818.         layerPopup.innerHTML = strMenu;
  1819.         stylePopup = layerPopup.style;
  1820.  
  1821.         _BSPSGetClientSize();
  1822.  
  1823.         // Get the position of the item causing the event (relative to its parent)
  1824.         //if (gbMac) {
  1825.         if (true) {
  1826.             nEventX = window.event.clientX;
  1827.             nEventY = window.event.clientY;
  1828.         } else {
  1829.             //??? YJ: Can not remember why we calculate envent position by following code...
  1830.             //but it is wrong in a case like: CENTER->P->TABLE:
  1831.             //the offset positions of TABLE, P and CENTER are same (same offsetTop,offsetLeft)
  1832.             //so we get triple times of offset of x and y as we expect... 
  1833.  
  1834.             nEventX = window.event.srcElement.offsetLeft - document.body.scrollLeft;
  1835.             nEventY = window.event.srcElement.offsetTop - document.body.scrollTop;
  1836.  
  1837.             // Get the location of the parent
  1838.             var nParentLocX = 0;
  1839.             var nParentLocY = 0;
  1840.  
  1841.             var ParentItem = window.event.srcElement.offsetParent;
  1842.             while (ParentItem != null) {
  1843.                 if (ParentItem.offsetLeft)    {
  1844.                     nParentLocX += ParentItem.offsetLeft;
  1845.                     nParentLocY += ParentItem.offsetTop;
  1846.                 }
  1847.                 ParentItem = ParentItem.parentElement;
  1848.             }
  1849.  
  1850.             // Adjust the location of the item using the location of the parent(s)
  1851.             nEventX += nParentLocX;
  1852.             nEventY += nParentLocY;
  1853.         }
  1854.  
  1855.         if (nEventY + layerPopup.scrollHeight + 10 < gBsClientHeight) {
  1856.             nEventY += document.body.scrollTop + 10;
  1857.         } else {
  1858.             nEventY = (document.body.scrollTop + gBsClientHeight) - layerPopup.scrollHeight - 20;
  1859.         }
  1860.         stylePopup.top = nEventY;
  1861.  
  1862.         if (nEventX + layerPopup.scrollWidth + 20 > gBsClientWidth) {
  1863.             if (gBsClientWidth - layerPopup.scrollWidth < 5) {
  1864.                 stylePopup.left = 5;
  1865.             } else {
  1866.                 stylePopup.left = gBsClientWidth - layerPopup.scrollWidth - 5;
  1867.             }
  1868.         } else {
  1869.             stylePopup.left = nEventX + document.body.scrollLeft + 20;
  1870.         }
  1871.  
  1872.         stylePopup.visibility = "visible";
  1873.         document.onclick = PopupMenu_HandleClick;
  1874.     } else if (gbNav4) {
  1875.         layerPopup = document.layers.PopupMenu;
  1876.         layerPopup.visibility = "hide";
  1877.         stylePopup = layerPopup.document;
  1878.         stylePopup.write(strMenu);
  1879.         stylePopup.close();
  1880.         var e = fn_arguments[0];
  1881.         nEventX = e.pageX;
  1882.         nEventY = e.pageY;
  1883.         _BSPSGetClientSize();
  1884.         if (nEventY + layerPopup.clip.height + 20 < window.pageYOffset + gBsClientHeight) {
  1885.             nEventY += 20;
  1886.         } else {
  1887.             nEventY = gBsClientHeight + window.pageYOffset- layerPopup.clip.height - 20;
  1888.         }
  1889.         layerPopup.top = nEventY;
  1890.  
  1891.         if (nEventX + layerPopup.clip.width + 20 > gBsClientWidth + window.pageXOffset) {
  1892.             if (gBsClientWidth + window.pageXOffset - layerPopup.clip.width < 20) {
  1893.                 nEventX = 5;
  1894.             } else {
  1895.                 nEventX = gBsClientWidth + window.pageXOffset - layerPopup.clip.width - 20;
  1896.             }
  1897.         } else {
  1898.             nEventX += 20;
  1899.         }
  1900.  
  1901.         layerPopup.left = nEventX;
  1902.  
  1903.         layerPopup.visibility = "show";
  1904.  
  1905. //        window.captureEvents(Event.CLICK | Event.MOUSEDOWN);
  1906.         window.captureEvents(Event.MOUSEDOWN);
  1907. //        window.onclick = PopupMenu_HandleClick;
  1908.         window.onmousedown = PopupMenu_HandleClick;
  1909.     }
  1910.  
  1911.     window.gbInPopupMenu = true;
  1912.     window.gbPopupMenuTimeoutExpired = false;
  1913.     setTimeout("PopupMenu_Timeout();", 100);
  1914.     return false;
  1915. }
  1916.  
  1917.  
  1918. function PopupMenu_Timeout()
  1919. {
  1920.     window.gbPopupMenuTimeoutExpired = true;
  1921. }
  1922.  
  1923. function PopupMenu_Over(e)
  1924. {
  1925.     if (gbIE4) {
  1926.         e.srcElement.className = "PopupOver";
  1927.     } else if (gbNav4) {
  1928. //        this.bgColor = "red";
  1929. //        e.target.document.className = "PopupOver";
  1930.     }
  1931.     return;
  1932. }
  1933.  
  1934. function PopupMenu_Out(e)
  1935. {
  1936.     if (gbIE4) {
  1937.         e.srcElement.className = "PopupNotOver";
  1938.     } else if (gbNav4) {
  1939.         this.bgColor = "#f0f0f0";
  1940.     }
  1941.     return;
  1942. }
  1943.  
  1944.  
  1945. function PopupMenu_HandleClick(e)
  1946. {
  1947.     if (!window.gbPopupMenuTimeoutExpired) {
  1948.         return;
  1949.     }
  1950.  
  1951.     window.gbInPopupMenu = false;
  1952.  
  1953.     if (gbNav4) {
  1954. //        window.releaseEvents(Event.CLICK);
  1955.         window.releaseEvents(Event.MOUSEDOWN);
  1956.     }
  1957.  
  1958.     var layerPopup = null;
  1959.     var stylePopup = null;
  1960.     if (gbIE4) {
  1961.         layerPopup = document.all["PopupMenu"];
  1962.         stylePopup = layerPopup.style;
  1963.         stylePopup.visibility = "hidden";
  1964.     } else if (gbNav4) {
  1965.         layerPopup = document.layers.PopupMenu;
  1966.         layerPopup.visibility = "hide";
  1967.     }
  1968.  
  1969.     return;
  1970. }
  1971.  
  1972. // This function should be deleted when all old projects are cleaned up
  1973. function BSPSWritePopupFrameForIE4()
  1974. {
  1975.     return false;
  1976. }
  1977.  
  1978. /////////////////////////////////////////////////////////////////////
  1979. function BSSCPopup_ClickMac()
  1980. {
  1981.     if ((!DHTMLPopupSupport()) && (gbIE4))
  1982.     {    
  1983.         var bClickOnAnchor = false;
  1984.         var el;
  1985.         if ((window.event != null) &&
  1986.             (window.event.srcElement != null))
  1987.         {
  1988.             el = window.event.srcElement;
  1989.             while (el != null)
  1990.             {
  1991.                 if ((el.tagName == "A") || (el.tagName == "AREA"))     {
  1992.                     bClickOnAnchor = true;
  1993.                     break;
  1994.                 }
  1995.                 if (el.tagName == "BODY") {
  1996.                     break;
  1997.                 }
  1998.                 el = el.parentElement;
  1999.             }
  2000.         }
  2001.         if (BSSCPopup_IsPopup())
  2002.         {
  2003.             if (!bClickOnAnchor) {
  2004.                 parent.window.gPopupWindow = null;
  2005.                 self.close();
  2006.             }
  2007.         }
  2008.         else
  2009.         {
  2010.             bClosePopupWindow = true;
  2011.             if ((bClickOnAnchor) &&
  2012.                 (el.href) &&
  2013.                 (el.href.indexOf("javascript:BSSCPopup") != -1))
  2014.             {
  2015.                 bClosePopupWindow = false;
  2016.             }
  2017.             if (bClosePopupWindow)
  2018.             {
  2019.                 if (window.gPopupWindow != null)
  2020.                 {
  2021.                     var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=300,width=400";
  2022.                     window.gPopupWindow = window.open("", gstrPopupSecondWindowName,strParam);
  2023.                     window.gPopupWindow.close();
  2024.                     window.gPopupWindow = null;
  2025.                 }
  2026.             }
  2027.         }
  2028.     }
  2029.  }
  2030.  
  2031. //////////////////////////////////////////////////////////////////////
  2032.  
  2033. _BSPSGetBrowserInfo();
  2034.  
  2035. function _BSSCOnLoad()
  2036. {
  2037.     if (!gbIE4 && !gbNav4)
  2038.         return;
  2039.  
  2040.     // Make everything visible in navigator
  2041.     if (gbNav4) {
  2042.         // Make some special effects items visible
  2043.         for (var iLayer = 0; iLayer < document.layers.length; iLayer++) {
  2044.             document.layers[iLayer].visibility = gBsStyVisShow;
  2045.             document.layers[iLayer].left = 0;
  2046.         }
  2047.     }
  2048.  
  2049.     // Remove the NavBar if necessary
  2050.     RemoveNavBar();
  2051.         
  2052.     // Don't continue without IE4
  2053.     if (gbIE4) {
  2054.         HHActivateComponents();
  2055.         doStaticEffects();
  2056.         startAnimationSet(0);
  2057.     }
  2058. }
  2059.  
  2060. function _BSSCOnUnload()
  2061. {
  2062. }
  2063.  
  2064. function _BSSCOnClick()
  2065. {
  2066.     if (!gbIE4)
  2067.         return;
  2068.  
  2069.     BSSCPopup_ClickMac();
  2070.     startNextAnimationSet();
  2071. }
  2072.  
  2073. function _BSSCOnError(message)
  2074. {
  2075.     if(-1 != message.indexOf("denied") 
  2076.         || -1 != message.indexOf("Object required"))
  2077.      return true;
  2078. }
  2079.  
  2080.  
  2081. function ResizeBasedonRate(thisWindow, size, rate, maxx, maxy)
  2082. {
  2083.     x = maxx;
  2084.     y = maxy;
  2085.     deltax = -maxx/2;
  2086.     while (true) {
  2087.         x = x + deltax;
  2088.         thisWindow.resizeTo(x, y);
  2089.         thisWindow.resizeTo(x, y);
  2090.         diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * rate;
  2091.         if (diffy >  gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
  2092.             deltax = Math.abs(deltax) /2;
  2093.         else if (diffy <  -permitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
  2094.             deltax = -Math.abs(deltax) /2;
  2095.         else 
  2096.             // the y is close enough to wanted.
  2097.             break;
  2098.         if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
  2099.             break;
  2100.         //j ++;
  2101.                 
  2102.     }
  2103.     size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;
  2104.     size.y = thisWindow.document.body.scrollHeight;// + gBscrollHeight;    
  2105.     thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little.
  2106. }
  2107.  
  2108. //////////BSSCDHTML Section Embedded Code//////////
  2109. var s_strAgent = navigator.userAgent.toLowerCase();
  2110. var s_nVer       = parseInt(navigator.appVersion);
  2111.  
  2112. var s_bIE  = (s_strAgent.indexOf('msie') != -1);
  2113. var s_bNS  = (s_strAgent.indexOf('mozilla') != -1) && ((s_strAgent.indexOf('spoofer') == -1) && (s_strAgent.indexOf('compatible') == -1));
  2114. var s_bOpera    = (s_strAgent.indexOf('opera') != -1);
  2115.  
  2116. var s_bIE3Before = ((s_bIE) && (s_nVer <= 2));
  2117. var s_bNS3Before = ((s_bNS) && (s_nVer <= 3));
  2118.  
  2119. var s_bNS2        = ((s_bNS) && (s_nVer <= 2));
  2120. var s_bNS3        = ((s_bNS) && (s_nVer == 3));
  2121. var s_bIE300301    = ((s_bIE) && (s_nVer == 2) && ((s_strAgent.indexOf("3.00") != -1)||(s_strAgent.indexOf("3.0a") != -1)||(s_strAgent.indexOf("3.0b")!=-1)||(s_strAgent.indexOf("3.01")!=-1)));
  2122. var s_bIE302    = ((s_bIE) && (s_nVer == 2) && (s_strAgent.indexOf("3.02") != -1));
  2123.  
  2124.  
  2125. function HasExtJs()
  2126. {
  2127.     if (s_bIE3Before) { return false;}
  2128.     if (s_bNS3Before) {    return false;}
  2129.     if (typeof (_BSSCOnLoad) == "undefined"){ return false; }
  2130.     return true;
  2131. }
  2132.  
  2133. function BSSCOnLoad()
  2134. {
  2135.     if (HasExtJs()) { _BSSCOnLoad(); }
  2136. }
  2137.  
  2138. function BSSCOnUnload()
  2139. {
  2140.     if (HasExtJs()) { _BSSCOnUnload(); }
  2141. }
  2142.  
  2143. function BSSCOnClick()
  2144. {
  2145.     if (HasExtJs()) { _BSSCOnClick(); }
  2146. }
  2147.  
  2148. function BSSCOnError(message)
  2149. {
  2150.     if (HasExtJs()) { return _BSSCOnError(message); }
  2151. }
  2152.  
  2153.  
  2154. function WritePopupMenuLayer()
  2155. {
  2156.     if (HasExtJs()) {_WritePopupMenuLayer();}
  2157. }
  2158.  
  2159. function BSSCCreatePopupDiv()
  2160. {
  2161.     if (HasExtJs()) {_BSSCCreatePopupDiv();    }
  2162. }
  2163.  
  2164. function BSSCPopup(strURL)
  2165. {
  2166.     if (HasExtJs())    { 
  2167.         _BSSCPopup(strURL);
  2168.     }else{
  2169.         //Create a temporary window first to ensure the real popup comes up on top
  2170.         var wndTemp = null;
  2171.         if (!s_bNS3) {
  2172.             wndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
  2173.         }
  2174.         // Create the real popup window
  2175.         var wndPopup = window.open(strURL, "BSSCPopup", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=300,width=400");
  2176.         // Close the temporary
  2177.         if (!s_bNS3) {
  2178.             wndTemp.close();
  2179.         } else {
  2180.             wndPopup.focus();
  2181.         }
  2182.     }
  2183. }
  2184.  
  2185. var gbWndTemp = null, gbWndPopupLinks = null;
  2186. var gbstrParaTotal = "";
  2187.  
  2188. function PopupMenu_Invoke()
  2189. {
  2190.     if (HasExtJs()) {
  2191.         return _PopupMenu_Invoke(PopupMenu_Invoke.arguments);
  2192.     }
  2193.     if (s_bNS3Before || s_bIE3Before )    {
  2194.         var argLen     = PopupMenu_Invoke.arguments.length;
  2195.         if (argLen < 5) {
  2196.             window.document.location.href = PopupMenu_Invoke.arguments[3];
  2197.             return false;
  2198.         }
  2199.         gbWndTemp = null;
  2200.         gbWndPopupLinks = null;
  2201.         gbstrParatotal = "";
  2202.         for (var i = 0; i < (argLen - 2) / 2; i++) {
  2203.             var strParaLine = "";
  2204.             if (s_bNS2 || s_bOpera){
  2205.                 strParaLine += "<a href=\"";
  2206.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
  2207.                 strParaLine += "\">"
  2208.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
  2209.                 strParaLine += "</a>";
  2210.             } else {
  2211.                 strParaLine += "<a href=\"javascript:";
  2212.                 strParaLine += "gotoUrl(\'";
  2213.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
  2214.                 strParaLine += "\');\"";
  2215.                 if (PopupMenu_Invoke.arguments[1] != '') {
  2216.                     strParaLine += " TARGET='" + PopupMenu_Invoke.arguments[1] + "'";
  2217.                 }
  2218.                 strParaLine += ">";
  2219.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
  2220.                 strParaLine += "</a>";
  2221.             }
  2222.             strParaLine += "<br>";
  2223.             gbstrParaTotal += strParaLine;
  2224.         }
  2225.         var nHeight = argLen * 15;
  2226.         var nWidth = 400;
  2227.         var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
  2228.         strParam += ",height=" + nHeight + ",width=200,resizable";
  2229.         
  2230.         //Create a temporary window first to ensure the real popup comes up on top
  2231.         //var wndTemp = null;
  2232.         if (!s_bNS3) {
  2233.             gbWndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
  2234.         } 
  2235.         gbWndPopupLinks = window.open("", "popuplinks", strParam);
  2236.  
  2237.         setTimeout("Wait_PopupMenuReady()", 100);
  2238.     }
  2239.     return true;
  2240. }
  2241.  
  2242. function Wait_PopupMenuReady() 
  2243. {
  2244.     if (gbWndPopupLinks != null && "object" == typeof(gbWndPopupLinks.document)) {
  2245.         PopupMenu_InvokeReady();
  2246.     }
  2247.     else 
  2248.         setTimeout("Wait_PopupMenuReady()", 100);
  2249. }
  2250.  
  2251.  
  2252. function PopupMenu_InvokeReady()
  2253. {
  2254.     if (gbWndPopupLinks != null) {
  2255.         gbWndPopupLinks.document.open("text/html");
  2256.         gbWndPopupLinks.document.write("<html><head>");
  2257.         if (s_bNS2 || s_bOpera) {
  2258.             gbWndPopupLinks.document.write("<base href=\"" + location +"\">");
  2259.         } else {
  2260.             //YJ: IE301,302 and NS3.x works fine
  2261.             gbWndPopupLinks.document.write("<");
  2262.             gbWndPopupLinks.document.write("script>");
  2263.             gbWndPopupLinks.document.write("function gotoUrl(aUrl) {opener.window.location=aUrl; close();}");
  2264.             gbWndPopupLinks.document.write("<");
  2265.             gbWndPopupLinks.document.write("/script>");
  2266.         }
  2267.         gbWndPopupLinks.document.write("</head><body onBlur=\'self.focus();\'>");
  2268.         gbWndPopupLinks.document.write(gbstrParaTotal);
  2269.         gbWndPopupLinks.document.write("</body></html>");
  2270.         gbWndPopupLinks.document.close();
  2271.  
  2272.         // Close the temporary
  2273.         if (!s_bNS3 && gbWndTemp != null) {
  2274.             gbWndTemp.close();
  2275.         }else {
  2276.             gbWndPopupLinks.focus();
  2277.         }
  2278.  
  2279.         return true;
  2280.     }
  2281.     return false;
  2282. }
  2283.  
  2284.   
  2285. onload = BSSCOnLoad;
  2286. document.onclick = BSSCOnClick;
  2287. onunload = BSSCOnUnload;
  2288. onerror = BSSCOnError;